home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 05 Programming / UWEDGE.MOR < prev    next >
Text File  |  2019-04-13  |  13KB  |  255 lines

  1.  LOADING FILES
  2.  
  3.  You can load an ASCII file or a PET-ASCII (CBM) file. Selection 4 for a CBM
  4.  file, or 4a for a standard ASCII file. If the file was not created with this
  5.  editor, the margins will default to 0 (left) and 80 (right), otherwise the
  6.  editor will create the margins from information contained in the first few
  7.  bytes of the file. More on how it does this later. It's a good idea to clear
  8.  text memory before a load, though, or you will have some merged text...it's
  9.  surprised me at times. This can also be used to some advantage. After the
  10.  load, the DOS message will be displayed until you press a key to return to
  11.  the menu. There you can read the file, edit it or re-save it as either an
  12.  ASCII or PET-ASCII file. I use the latter trick to convert files all the
  13.  time.
  14.  
  15.  
  16.  NOTE: On either the load or save function, you can abort reading or writing
  17.  with the STOP key. Pressing this key during these i/o operations will close
  18.  all files and return you to the editor's menu.
  19.  
  20.  
  21.  SAVING@FILES
  22.  
  23.  Same options are available, but you may want to know a few of the technical
  24.  details of the save. All blank lines are saved as a carriage return (or a
  25.  carriage return and linefeed for standard ASCII files). Also, you have the
  26.  option of adding extra carriage returns to the file to provide perforation
  27.  skips for your printer (you'll be prompted for this selection). If selected,
  28.  the editor will assume your text page is 66 lines per page. If you have your
  29.  lines per page set at 55 (function 2 from the menu), 11 carriage returns will
  30.  be added after every 55 lines. If you reload a file that has these extra
  31.  CR's, you'll see blank lines inserted in your text. Resaving such a file
  32.  without first deleting these lines could cause chaos in your page formatting,
  33.  so be sure you delete the lines prior to resaving. Also, if you save a file
  34.  that "maxed out" your text buffer, extra CR's will cause a reload to ignore
  35.  the last part of your lengthened document, so be aware of these details when
  36.  you make your choice.
  37.  
  38.  All files saved by the editor contain information for setting up the left and
  39.  right margins. This information is contained in the first few bytes. To
  40.  explain this, let's assume you are saving a document with a left margin of 5
  41.  and a right margin of 75. The first 5 bytes of the file will be nulls (binary
  42.  zeros), the next byte will be a 128 (separator) and the next 5 bytes will be
  43.  nulls. To printers, nulls and 128's are transparent...they are ignored. These
  44.  characters are also ignored by most BBS systems. CIS ignores them just fine.
  45.  However, the editor does not ignore them, and uses them to set up the margins
  46.  when you load the file. If your margins were set to 0 left & 80 right, no
  47.  nulls or separator bytes will be saved in the file. This makes the editor
  48.  useful for creating or editing source code files for an assembler (like the
  49.  CBM assembler).
  50.  
  51.  
  52.  NOTE: nulls are added to the file whenever the save routine comes across
  53.  underlined text (reverse video). One null is used to mark the start of the
  54.  underlined text, another the end. The load routine interprets these nulls in
  55.  reverse, toggling the text between reverse video and normal whenever it comes
  56.  across one. Occasionally, you may load a file that contains extra nulls in it
  57.  (some BBS systems may add a few extra). When this happens, you'll have a lot
  58.  of unwanted reverse video text. Use CTRL K to correct it (in the edit mode).
  59.  
  60.  
  61.  MERGING TEXT FILES
  62.  
  63.  Here's how you do it...load the first file and place the cursor past the last
  64.  line in the file (in the edit mode). Press the STOP key to take you back to
  65.  the menu and load the second file. The second file will start loading from
  66.  the line you left the cursor on when you went to the menu. Armed with that
  67.  information, one could merge (or insert) text from one file into another just
  68.  by leaving the cursor in the appropriate place in the text. You can even do
  69.  a "cut and paste" operation by opening up a gap in your text with CTRL i and
  70.  merging text from another file into the gap.
  71.  
  72.  
  73.  By now you have probably found out that you can leave the editor and do other
  74.  things without losing your document. If you use another wedge function that
  75.  writes to a buffer (like *b, *c, etc.), or disturb the basic start-of-variable
  76.  storage pointer, you'll have a lot of trouble recovering your document. What
  77.  you CAN do is exit to print, scratch or rename a file, read the directory, or
  78.  use any other command that doesn't disturb pointers or re-allocate buffers.
  79.  For convenience, access to the DOS commands and the directory reader are
  80.  provided from the editor menu.
  81.  
  82.  
  83.  PRINTING A FILE
  84.  
  85.  
  86.  You can use the wedge *p command to print a CBM file, or the editor's
  87.  printing routine to print directly from your text workspace.
  88.  
  89.  The editor's printing routine has several additional features that the SEQ
  90.  file printer lacks, and should work with any CBM-compatible printer setup. A
  91.  bit of background on how it works will help you set it up for your printer to
  92.  use the special features (underlining and enhanced print).
  93.  
  94.  You will be prompted first for the place to start printing (from the
  95.  beginning line or from the last line the cursor was on).
  96.  
  97.  Next, right justification instructions. Right justification will happen only
  98.  on lines with 10 or less spaces at the end of the line, and only if the line
  99.  has at least 4 words on it (formatting safety precautions). These precautions
  100.  are necessary to prevent "ugly" lines with 4 or more spaces between words.
  101.  
  102.  Next prompt is for enhanced print (user-defined...more on this later).
  103.  
  104.  Next is linked printing prompt. This is for documents too big to fit into the
  105.  workspace all at once, and had to be saved in two or more files. Answering
  106.  "yes" to this prompt will cause the line counter to remember the number of
  107.  the last line it printed (so that it can page properly on a linked document).
  108.  For example, let's say you wanted to print a large document that was saved in
  109.  three files. On the first file, you would answer "no" to the prompt, but on
  110.  each of the next files, answer "y".
  111.  
  112.  Next prompt is for the number of copies you want. This prompt will not be
  113.  offered if you answered "y" to the linked printing prompt.
  114.  
  115.  The last prompt gives you a chance to abort printing before it starts.
  116.  Answering yes will start printing. You can stop printing (if you have to)
  117.  with the STOP key at any time. If you do, you'll be returned to the editor's
  118.  menu screen.
  119.  
  120.  TECHNICAL@INFO
  121.  
  122.  Two files are opened to the printer. One file is used to send commands, the
  123.  other is for text. Most non-CBM printer/interface setups allow the option of
  124.  choosing secondary addresses...usually, a secondary address of 7 is used for
  125.  upper and lower case printing, and allows conversion of PETascii to standard
  126.  ascii when sending text. Also, you can usually choose a secondary address for
  127.  what is commonly called a "transparent" mode (sending data without any
  128.  translation). On CARDCO interfaces this is 4 or 5. The editor's printing
  129.  routine is set to open files of 7,4,7 (text) and 5,4,5 (commands). The
  130.  transparent mode was chosen for commands so that you don't have to worry
  131.  about them being translated into something else on the way to the printer.
  132.  Saves a lot of confusion and weird printer antics. One rule here...you must
  133.  use different file numbers for text and command files (how to choose them
  134.  later).
  135.  
  136.  The first thing the printing routine will do is send a "setup" string to your
  137.  printer. A setup string is a string of codes that one would usually use to
  138.  ensure the printer is set to all default conditions, or to make certain
  139.  special functions are set the way you want them to be. This string should
  140.  also contain the codes to disable enhanced print and underlining. You can
  141.  define this string (instructions in a moment).
  142.  
  143.  Then, if you selected enhanced print, another string is sent. These are
  144.  usually the codes that enable boldface print, italics, or whatever other
  145.  feature you wish to define as enhanced print.
  146.  
  147.  Next, the document is printed. Depending on how you answered the printer
  148.  prompts, you could right-justify the lines, print the document in boldface,
  149.  or both at once.
  150.  
  151.  SETTING UP THE STRINGS
  152.  
  153.  There are 4 strings you will have to define according to your individual
  154.  printer/interface setup. The printing routine will work if you don't, but all
  155.  strings will be sent as null strings unless you define them. This means that
  156.  your printer cannot underline or do enhanced printing as commanded from the
  157.  printing routine until you define the command strings.
  158.  
  159.  The command strings are stored in a table as a series of bytes. Let's take
  160.  the setup string first (example is in decimal).
  161.  
  162.  byte1 byte2 byte3 byte4 byte5 byte6
  163.  
  164.   2     27    64    --    --    --
  165.  
  166.  The codes for my printer to clear to all default values are 27 and 64. The
  167.  first byte in the setup string (byte1) should be the length of the string.
  168.  Then the actual codes should follow in the succeeding bytes. The setup string
  169.  can contain up to 32 bytes (length byte + 31 codes). If you had a string to
  170.  send like this... 27,64,27,45,27,88,27,92...the table should look like this:
  171.  
  172.  8  27  64  27  45  27  88  27  92
  173.  
  174.  The next string in the table contains the enhanced printing codes. These
  175.  codes can be for whatever you want to use for enhanced printing (boldface,
  176.  italics, shadow print, etc.). Same rules as in the setup string, but the
  177.  maximum string length is 16 bytes.
  178.  
  179.  The third string is for enabling underlining. 16 bytes max.
  180.  
  181.  The last string is for disabling underlining. 16 bytes max.
  182.  
  183.  DEFINING THE FILES/SECONDARY ADDRESSES
  184.  
  185.  The editor is defaulted to use a secondary address of 7 (in the file opening
  186.  command "open 7,4,7") for text. This will cause the printer/interface (in my
  187.  case) to expect CBM ascii (upper and lower case), and will perform a carriage
  188.  return and linefeed when it receives a carriage return. If you need a
  189.  different secondary address for this to happen with your printer, you should
  190.  reset this number to the value you need.
  191.  
  192.  5 is the default secondary address for the command file (open 5,4,5). This is
  193.  the file that the editor uses to send command strings to the printer. No
  194.  translation of the codes should take place through this file. Carriage
  195.  returns will not be sent, so it doesn't matter if this address causes a
  196.  carriage/linefeed when it gets a carriage return...it'll never get one, just
  197.  escape codes/command strings.
  198.  
  199.  If you want to communicate with your printer in standard ascii, all you have
  200.  to do is change a flag (details soon). When you set the flag for ascii, the
  201.  editor will also send a linefeed after each carriage return. Example:
  202.  
  203.  For a CARDCO interface and Prowriter 8510 printer, if you want to communicate
  204.  in standard ascii, set the ascii flag to 0, the secondary address for text to
  205.  5 (transparent mode, no linefeed) and the secondary address for commands to
  206.  4 (transparent mode, linefeed doesn't matter).
  207.  
  208.  Note that although both files are transparent mode, I chose different
  209.  addresses for text and command files. This is because the secondary address
  210.  number is also used as the file number. If the numbers were the same, the
  211.  editor would try to open the same file twice, and terminate with an error
  212.  message whenever you tried to print.
  213.  
  214.  MODIFYING THE@EDITOR CODES/STRINGS
  215.  
  216.  Load the wedge, but don't run it. Now you can poke the changes into the
  217.  tables and resave the new wedge. Here are the locations you will need:
  218.  
  219.  
  220.  
  221.                           HEX    DECIMAL
  222.  
  223.  Ascii/ CBMascii flag -> $41f8   16888  (zero for ascii, 255 for CBM)
  224.  
  225.  Text file #          -> $43c3   17347
  226.  
  227.  Command file #       -> $43c7   17351
  228.  
  229.  Setup string         -> $50b8   20664 to 20695
  230.  
  231.  Enhanced string      -> $50d8   20696 to 20711
  232.  
  233.  Underline "on" string-> $50e8   20712 to 20727
  234.  
  235.  U/l "off" string     -> $50f8   20728 to 20743
  236.  
  237.  
  238.  You can make the changes with an ML monitor, or poke them in from basic.
  239.  Either way, it may help to make up a chart to aid you in making the changes.
  240.  
  241.  Also, never set the length byte of any of the 4 command strings to zero, or
  242.  you'll get very strange results. If you want the editor to ignore the string,
  243.  set the first byte to 1 and the second to zero. All 4 strings are set this
  244.  way initially anyway, ready for you to redefine them.
  245.  
  246.  
  247.  Well, that's about it. I always appreciate hearing from other users of these
  248.  programs...many times I get additional ideas for expansion or improvement
  249.  that way. Electronic mail is easiest...On Delphi, my ID is JIMKLITZING, on
  250.  Compuserve it's 75206,2536
  251.  
  252.  Hope to be hearing from you...
  253.  
  254.  Jim
  255.